//#include "mypwrctrl.h"

//MyPwrCtrl :: MyPwrCtrl(DataProvider* dp)
//{
//    this->dataProvider = dp;
//}

//void MyPwrCtrl ::run(){
//    unsigned int nS1,nS2;
//    unsigned int Timestamp[6];
//    qreal    x1,x2,x3;
//    nS1=nS2=0;
////    usleep(5000000);

////    while(true)
////    {
////        usleep(1000);

////        if(0xfff != this->dataProvider->GetFusionReg(rKEY_VALUE)) {
////            this->dataProvider->SetFusionReg(rSD_WP,00); // enable SD_WP
////            nS2 = 0;
////        }

////        if(nS1 == this->dataProvider->GetFusionReg(rPUSH_STAT)){
////            nS2 ++;
////        }
////        else {
////            nS1 = this->dataProvider->GetFusionReg(rPUSH_STAT);
////            nS2 = 0;
////        }

////        if(nS2 >= this->dataProvider->GetPwrOff())
////        {
////            this->dataProvider->setMeltState(MeltPwrDown);
////            usleep(10000000);
////            break;
////        }
////        /*
////        else if(nS2 == this->dataProvider->GetStandBy())
////        {
////            this->dataProvider->setMeltState(MeltPwrSave);
////            usleep(1000000);
////        }
////        */

////        if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xfcb){ //SHIFT + LEFT + RIGHT
////            this->dataProvider->TestProg();
////            break;
////        }
////        if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xf5e){ //SHIFT + MENU + DISH
////            break;
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xfcf){ // SHIFT + RIGHT
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xfdb){ // SHIFT + LEFT
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xf9f){ // SHIFT + UP
////            if(this->dataProvider->getMeltMode() == Manual){
////                this->dataProvider->x_motor_ctrl(1,(10 - this->dataProvider->getManualSpeed()),0,0,0,0xffff);
////            }
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xfdd){ // SHIFT + DOWN
////            if(this->dataProvider->getMeltMode() == Manual){
////                this->dataProvider->y_motor_ctrl(1,(10 - this->dataProvider->getManualSpeed()),0,0,0,0xffff);
////            }
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xf5f){ // SHIFT + OK
////            this->dataProvider->x_motor_ctrl(1,1,1,1,1,0x0);
////            this->dataProvider->y_motor_ctrl(1,1,1,1,1,0x0);
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xfb7){
////            this->dataProvider->DecPrintLevel();
////            usleep(1000000);
////        }
////        else if(this->dataProvider->GetFusionReg(rKEY_VALUE) == 0xff5){
////            this->dataProvider->IncPrintLevel();
////            usleep(1000000);
////        }

////        if((this->dataProvider->GetFusionReg(rTOUCH_STATUS)&0x80000000) != 0) {
////            this->dataProvider->setMeltState(MeltPwrDown);
////            break;
////        }

////        if(((nS2%2000) == 0)&&(this->dataProvider->getPrintLevel() > 5)){
////            this->dataProvider->get_rtc_remote_time(Timestamp);
////            qDebug("rTOUCH_STATUS = %x :rPUSH_STAT = %x :rFIBER_STATUS = %x :rPUSH_MOTOR= %x, MeltState  = %x",
////                    this->dataProvider->GetFusionReg(rTOUCH_STATUS),
////                    this->dataProvider->GetFusionReg(rPUSH_STAT),
////                    this->dataProvider->GetFusionReg(rFIBER_STATUS),
////                    this->dataProvider->GetFusionReg(rPUSH_MOTOR),
////                    this->dataProvider->getMeltState());
////            qDebug("rHEAT_CTRL = %x : rPUSH_CTRL    = %x : rAUX_CTRL    = %x",
////                    this->dataProvider->GetFusionReg(rHEAT_CTRL),
////                    this->dataProvider->GetFusionReg(rPUSH_CTRL),
////                    this->dataProvider->GetFusionReg(rAUX_CTRL));
////            qDebug("CAM0Param=%x,CAM1Param=%x",
////                    this->dataProvider->GetFusionReg(rCAM0_PARAM),
////                    this->dataProvider->GetFusionReg(rCAM1_PARAM));
////            x1 = (this->dataProvider->GetFusionReg(rCORETEMP)*503.975 )/0x10000 - 273.15;
////            x2 = (this->dataProvider->GetFusionReg(rVPIN) * 13.0)/0x10000;
////            qDebug("CPU TEMP=%.2f deg,rVPIN=%.2f vol",x1,x2);
////            //this->dataProvider->cliberate_process();
////        }
////    }

////    qDebug("Watch process exited!!");
//}
